REM Delete old version of EXE
if exist compile.exe del compile.exe

REM MPSGE module
lf95 -c mpsge
if errorlevel 1 goto error
lm mpsge -+mpsge ;

REM MPSGP module
lf95 -c mpsgp
if errorlevel 1 goto error
lm mpsgp -+mpsgp ;

REM main program
lf95 compile -lib mpsgp mpsge 
if errorlevel 1 goto error2

REM Run the program
compile > compile.out
if errorlevel 1 goto runerror

goto ranok

:error
@echo off
echo .
echo Error compiling MPSGE routines
echo .
goto end

:error2
@echo off
echo .
echo Error compiling and linking main program
echo .
goto end

:runerror
@echo off
echo .
echo Error running main program
echo .
goto end

:ranok
@echo off
echo .
echo Seems to have compiled and ran ok
echo .
goto end


:end
